import type { AxiosRequestConfig, AxiosResponse } from 'axios'

// 定义请求拦截的接口
export interface YZRequestInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (response: T) => T
  responseInterceptorCatch?: (error: any) => any
}

// 扩展原来的请求配置加入拦截器
export interface YZRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: YZRequestInterceptors<T>
  showLoading?: boolean
}
